package com.dx.converter.utils.InterfaceBoConverter;

import com.dx.entity.bo.InterfaceBo;
import com.dx.entity.dto.InterfaceBoDto;
import com.dx.utils.JsonUtils;
import org.springframework.beans.BeanUtils;

public class InterfaceBoConverter {

    public static InterfaceBo convertToBo(InterfaceBoDto interfaceBoDto) {
        InterfaceBo interfaceBo = new InterfaceBo();
        BeanUtils.copyProperties(interfaceBoDto, interfaceBo);
        interfaceBo.setRequestBody(JsonUtils.toJson(interfaceBoDto.getRequestBody()));
        return interfaceBo;
    }
}
